<?php

use yii\helpers\Html;
use yii\grid\GridView;


$this->title = Yii::t('app', '信用卡支出统计');
$this->params['breadcrumbs'][] = $this->title;
?>

<style type="text/css">
    .cs1{margin:2px 5px;} 
</style>

<div class="product-index">

    <div class="box">
        <div class="box-header">
        </div>
        <div class="box-body">
            <?= GridView::widget([
            'dataProvider' => $dataProvider,
            'layout'  =>  "{items}\n{summary}\n{pager}",
            'columns' => [
                ['class' => 'yii\grid\SerialColumn'],
                
                'product.code',
                'product.name',
                [
                    'attribute' => 'cost_type',
                    'value' => function ($model) {
                            return \yii::$app->params['cost_type'][$model->cost_type];
                        },
                ],
                'supplier.en_name',
                [
                    'attribute' => 'payment',
                    'value' => function ($model) {
                            return \yii::$app->params['payment_type'][$model->payment];
                        },
                ],
                [
                    'attribute' => 'day_num',
                    'value' => function ($model) {
                            return $model->dayNum;
                        },
                ],
                'price',
                'remark',
                [
                    'attribute' => 'status',
                    'filter' =>  Yii::$app->params['status'],
                    'value' => function ($model) {
                            return \yii::$app->params['status'][$model->status];
                        },
                ],

                

                 [
                    'attribute' => 'user_id',
                    'value' => function ($model) {
                            return $model->userName;
                        },
                ],

               
                
                [
                    'attribute' => 'confirm',
                    'filter' =>  Yii::$app->params['confirm'],
                    'value' => function ($model) {
                            return \yii::$app->params['confirm'][$model->confirm];
                        },
                ],
               
            ],
        ]); ?>

            
        </div>
    </div>
</div>
